const LogsMongo = require('@mongodb/logs')
const Path = require("path")

/**
 * Log4
 */
require("@/lib/log4").init(Path.resolve(__dirname))

module.exports = function (app) {
  /**
   * 日志
   */
  require('../../YB-Security/lib/koaLogger')(app, (data) => {
    const log = {
      ...data,
      date: new Date()
    }
    LogsMongo.addServerProcess(log).then(() => {}).catch(() => {})
  })
}
